package com.admin.core.mapper;

import com.admin.core.entity.SysRole;
import com.admin.core.entity.SysUserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author sq-lan
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<SysUserRole> {

    /**
     * 插入数据
     *
     * @param userId 用户id
     * @param roles  角色
     */
    void insertData(@Param("userId") Integer userId, @Param("roles") List<SysRole> roles);

    /**
     * 按用户ID删除
     *
     * @param userIds 用户ID
     */
    void deleteByUserIds(@Param("userIds") Set<Integer> userIds);
}
